<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/libs/jquery-1.12.3.js"></script>
    <style>
        .box{
            width: 100px;
            height: 100px;
            border: 1px solid #000;
            background-color: skyblue;
            color: red;
            font-size: 40px;
        }
    </style>
</head>
<body>

    <button id="btn1">创建</button>
    <button id="btn2">创建并添加</button>
    <script>
        $(function(){
            $('#btn1').on("click",function(){
                $('body').append('<div class="box"></div>');
                return false;
            })
            $('#btn2').click(function(){
                $('#btn1').trigger('click');
                $('.box').text("111");
                return false;
            })
        })
    </script>
</body>
</html>